<?php
// -----------------------------------------------------------------------------

include "../config/config.php";
include "../DBManager.php";

// -----------------------------------------------------------------------------

if (!isset($_POST['date']) || !isset($_POST['content'])) {
    exit("需要传入有效的参数。");
}

$date = $_POST['date'];
$content = $_POST['content'];

// -----------------------------------------------------------------------------

$dbPath = "../" . $dbPath;
$db = new DBManager($dbPath);

// -----------------------------------------------------------------------------

try {
    $db->writeToFinished($content, $date);
} catch (Exception $e) {
    echo $e->getMessage();
}